﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Modules/ReconSite.Master" AutoEventWireup="true" CodeBehind="AuthorizeRemitter.aspx.cs" Inherits="Recon.Portal.WebUI.AuthorizeRemitter" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleHolder" runat="server">
    <title>Authorize Remitter</title>
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="BodyHolder" runat="server">
     <div class="formDiv" id="formMatchDiv">
        <asp:Panel ID="pnlAuthList" runat="server"  class="pnlMatchList">
            <div style="azimuth: center;">
                     <asp:Label ID="lblAuthList" runat="server" Text="List of remitter available for Authorization:" />
                     <asp:Button ID="btnAuthorize" runat="server" OnClick="btnAuthorize_Click" Text="Authorize" CssClass="btnRightAligned" />
                </div>
                <div style="height:380px; width:900px; overflow:auto;">
                <asp:GridView ID="grdAuthList" runat="server" AllowPaging="false" 
                        AutoGenerateColumns="False" Width="850"
                        HeaderStyle-BackColor="silver" HeaderStyle-ForeColor="#6f788f" 
                            HeaderStyle-Font-Bold="false"  
                        OnPageIndexChanging="grdAuthList_PageIndexChanging" 
                        onrowdatabound="grdAuthList_RowDataBound">
                    <EmptyDataTemplate>
                        <asp:Label ID="lblNoRows" runat="server" Text="There are no remitter available for Authorization." />
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:TemplateField HeaderText="Select" HeaderStyle-Font-Bold = "false">
                        <HeaderTemplate>
                                    <input id ="SelectAllCheckBox" type="checkbox" name="SelectAllCheckBox" onclick="javascript: SelectAllStatement(this)">
                           </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Literal ID="ltlRemitterId" runat="server" Text='<%# Eval("RemitterID") %>'
                                    Visible="false" />
                                <asp:Literal ID="ltlRemitterName" runat="server" Text='<%# Eval("RemitterName") %>'
                                    Visible="false" />
                                <asp:CheckBox ID="chkSelect" runat="server" Checked="true" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Remitter Id" DataField="RemitterID" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                        <asp:BoundField HeaderText="Name" DataField="RemitterName" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                        <asp:BoundField HeaderText="Address" DataField="Address1" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                        <asp:BoundField HeaderText="City" DataField="City" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                        <asp:BoundField HeaderText="State" DataField="State" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                        <asp:BoundField HeaderText="Country" DataField="Country" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                        <asp:BoundField HeaderText="Email Id" DataField="EmailAddress" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                        <asp:BoundField HeaderText="Discount Code" DataField="DiscountCode" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                        <asp:BoundField HeaderText="Penalty Code" DataField="PenaltyCode" HeaderStyle-Font-Bold = "false" ItemStyle-HorizontalAlign="Center"/>
                    </Columns>
                </asp:GridView>
                </div>
           <%-- </span>--%>
            
        </asp:Panel>
        <asp:UpdatePanel ID="upUnmatchedLists" runat="server" UpdateMode="Conditional">
        <ContentTemplate>    
                <div id="pnlMatchList" runat="server" class="pnlMatchList">    
                    <span style="azimuth: center;">
                        <div id="Div1" class="formDiv" runat ="server"  >
                            <center>
                                <asp:Label ID="lblMessage" runat="server"    CssClass="lable"/>
                            </center>
                        </div>
                    </span>
                    <div class="formDiv" style="width: 30%;">
                         <center>
                            <asp:Button ID="btnok" runat="server" Text="OK" onclick="btnok_Click" CausesValidation="False"  />
                          </center>
                    </div>
                </div>
            <div style="display: none">
                <asp:Button ID="btnManualPopup" runat="server" />
            </div>
            <ajax:ModalPopupExtender ID="btnClickPopup" runat="server" PopupControlID="pnlMatchList"
                TargetControlID="btnManualPopup" BackgroundCssClass="modalBackground" RepositionMode="RepositionOnWindowScroll" OkControlID = "btnok">
            </ajax:ModalPopupExtender>   
        </ContentTemplate>        
    </asp:UpdatePanel>
    </div>
    <script type="text/javascript">
        function SelectAllStatement(CheckBoxControl) {
            if (CheckBoxControl.checked == true) {
                var i;
                for (i = 0; i < document.forms[0].elements.length; i++) {
                    if ((document.forms[0].elements[i].type == 'checkbox') && (document.forms[0].elements[i].name.indexOf('grdAuthList') > -1)) {
                        document.forms[0].elements[i].checked = true;
                    }
                }
            }
            else {
                var i;
                for (i = 0; i < document.forms[0].elements.length; i++) {
                    if ((document.forms[0].elements[i].type == 'checkbox') &&
                    (document.forms[0].elements[i].name.indexOf('grdAuthList') > -1)) {
                        document.forms[0].elements[i].checked = false;
                    }
                }
            }
        }
        </script>
</asp:Content>
